﻿$(document).ready(function () {
    $("#ProvinceSelect").change(function () {
        var provinceid = $("#ProvinceSelect").val();
        $("#citylist").empty().append("<option value=''>Select City</option>");
        if (provinceid != "") {
            $.ajax({
                type: "GET",
                url: "/City/GetCityByProvinceID",
                data: { id: provinceid },
                dataType: "json",
                success: function (data) {
                    if (data.length > 0) {
                        for (var item in data) {
                            $("#citylist").append("<option value='" + data[item].CityID + "'>" + data[item].CityName + "</option>");
                        }
                    }

                }
            });
        }
    })
})